﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjectChords.Services.Models
{
    /// <summary>
    /// Represents a quiz that is remotely located at a web URL.
    /// </summary>
    public class QuizItem
    {
        public string Id { get; set; }

        /// <summary>
        /// Unique Id of the quiz app that is remotely located.
        /// Each Quiz app is identified by a unique Id when they communicate
        /// with the Chords server application
        /// </summary>
        public string QuizAppId { get; set; }

        public string Url { get; set; }

        /// <summary>
        /// Unique Id of the associated ContentItem that this quiz is for.
        /// </summary>
        public string ContentItemId { get; set; }

        public string Title { get; set; }
        public string Description { get; set; }

        /// <summary>
        /// Maximum possible score for this quiz.
        /// Must be a positive int
        /// </summary>
        private int maxScore;
        public int MaximumScore
        {
            get
            {
                return maxScore;
            }
            set
            {
                if (value < 0)
                {
                    throw new ArgumentOutOfRangeException("MaximumScore", "The MaximumScore must be a positive integer.");
                }
                else
                {
                    maxScore = value;
                }
            }
        }
    }
}
